<template>
        <div class="good-tenant">
          
      <div class="top">
        <strong>优选租客</strong><span @click='goBack'><img src="../../assets/icon/向左返回.svg" alt=""> 返回首页</span>
      </div>
      <div v-for="item in res">
        <router-link to="/home/sonMessage">
          <section class="tenant-message">
            <img :src="item.portrait" alt="" />
            <div class="tt-message">
              <div class="sir">
                <strong>{{ item.name }}</strong>
                |
                <span class="bg1">{{ item.methods }}</span>
                <span class="bg2">{{ item.age }}岁</span>
              </div>
              <p>预计租期:{{ item.term }}</p>
              <p>期望入住时间: {{ item.date }}</p>
            </div>
          </section>
          <div class="choie">
            <ul>
              <li>
                <p>意向区域</p>
                <span>{{ item.city }}</span>
              </li>
              <li>
                <p>租金范围</p>
                <span>{{ item.rent }}/月</span>
              </li>
            </ul>
          </div>
        </router-link>
      </div>
    </div>
</template>
<script>
export default {
    data(){
        return{
            res:[]
        }
    }
    ,methods:{
            //租客信息的方法
    getData() {
      let url = "data/find.json";
      let pro = axios.get(url);
      pro.then((res) => {
        // console.log(res.data.result);
        this.res = res.data.result;
      }),
        pro.catch((err) => {
          console.log(err);
        });
    },
    goBack(){
        this.$router.go(-1)
    }
    },
      mounted() {
    this.getData();
  },
}
</script>
<style lang="scss" scoped>
 .good-tenant {
    width: 90%;
    font-size: 14px;
    margin: 0 auto;
    .top {
      width: 100%;
      height: 50px;
      display: flex;
      justify-content: space-between;
      border-bottom: 1px solid gray;
      align-items: center;
      strong{
          font-size: 20px;

      }
      img{
        width: 15px;
        vertical-align:text-bottom;
      }
    }
    .tenant-message {
      display: flex;
      margin-top: 15px;
      img {
        width: 45px;
        height: 45px;
        border-radius: 50%;
      }
      .tt-message {
        margin-left: 10px;
        p {
          // padding: .5px;
          margin: 5px;
          color: gray;
        }
        .sir {
          display: flex;
          strong {
            margin-right: 8px;
          }
          .bg1 {
            display: block;
            width: 40px;
            text-align: center;
            background-color: #4783f7;
            color: rgb(243, 239, 239);
            margin-left: 8px;
            font-size: 12px;
          }
          .bg2 {
            padding: 1px;
            box-sizing: border-box;
            background-color: rgb(236, 230, 230);
            margin-left: 5px;
            font-size: 12px;
          }
        }
      }
    }
    .choie {
      margin-top: 10px;
      ul {
        display: flex;
        justify-content: space-between;
        li:nth-child(1) {
          border-right: 1px solid rgb(240, 233, 233);
          padding-right: 5px;
        }
        li {
          width: 50%;
          text-align: center;
          border-bottom: 1px solid rgb(236, 229, 229);
          padding-bottom: 10px;

          p {
            margin: 0;
          }
          span {
            color: rgb(233, 109, 26);
          }
        }
      }
    }
  }
</style>